<template>
  <div class="container">
    <el-form ref="form" :model="form" :rules="rules" label-width="210px">
      <el-form-item label="发件人昵称：">
        <div v-text="form.nickName"></div>
      </el-form-item>
      <el-form-item label="发件服务器账户：">
        <div v-text="form.username"></div>
      </el-form-item>
      <el-form-item label="收件人：">
        <div v-text="form.tos"></div>
      </el-form-item>
      <el-form-item label="抄送人：">
        <div v-text="form.ccs"></div>
      </el-form-item>
      <el-form-item label="密送人：">
        <div v-text="form.bccs"></div>
      </el-form-item>
      <el-form-item label="主题：">
        <div v-text="form.subject"></div>
      </el-form-item>
      <el-form-item label="内容：">
        <div v-text="form.content"></div>
      </el-form-item>
      <el-form-item label="发送结果：">
        <div>
          {{ $enum.getMapValue("result", form.result).name }}
        </div>
      </el-form-item>
      <el-form-item label="错误原因：">
        <div v-text="form.errorMsg"></div>
      </el-form-item>
      <el-form-item label="发送次数：">
        <div v-text="form.sendCount"></div>
      </el-form-item>
      <el-form-item label="创建时间：">
        <div v-text="form.createdTime"></div>
      </el-form-item>
      <el-form-item label="更新时间：">
        <div v-text="form.modifiedTime"></div>
      </el-form-item>

      <el-form-item>
        <el-button size="small" @click="goBack">取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>

import {mailLogDetailApi} from "../../api/log/mailLog";

export default {
  data() {
    return {
      form: {},
    };
  },
  methods: {
    // 编辑操作
    getDetail(id) {
      mailLogDetailApi({id}).then((res) => {
        this.form = res?.bizData;
      });
    },
    goBack() {
      this.$router.goPage({
        path: "/mail/log/page",
      });
    },
  },
  created() {
    const {id} = this.$route.query;
    this.getDetail(id);
  },
};
</script>
